<template>
  <page-wrap :show-top="showTop" :bg-color="uNavColor">
    <!-- <view class="person-top" :style="'padding-top:' + navHeight + 'px;'"></view> -->
    <view class="page-container">
      <view class="header-area">
        <view class="header-top" @click="toResume">
          <view class="header-user-info">
            <u-image width="54px" height="54px" shape="circle" :src="userInfo.pic || defaultAvatar"></u-image>
            <view v-if="personId && userInfo && userInfo.id">
              <view class="header-user-name">{{ userInfo.iname || userInfo.id }}</view>
              <view class="flex-row">
                <text class="header-user-tips">编辑在线简历</text>
                <u-image width="12px" height="12px" :src="editImg"></u-image>
              </view>
            </view>
            <view v-else class="margin-left-10"> 点击登录/注册 </view>
          </view>
          <view class="flex-row" v-if="currentScore">
            <view class="header-resume-tips"><span style="color: red">{{ currentScore +
              '' }}</span>个简历待优化项</view>
            <u-image width="12px" height="12px" :src="arrowImg"></u-image>
          </view>
        </view>
        <view class="header-bottom">
          <view class="header-item" v-for="(item, index) in headerItems" :key="index" @click="handleMessageRoute(item)">
            <u-badge :count="item.count" :offset="[0, 40]"></u-badge>
            <view class="header-itemNum">{{ item.num }}</view>
            <view class="header-itemTitle">{{ item.title }}</view>
          </view>
        </view>
      </view>

      <view class="special-function" v-if="advItems && advItems.length">
        <u-swiper height="140" name="path" interval="4000" :list="advItems" mode="none" @click="handleBannerLive"></u-swiper>
      </view>

      <view class="main-func">
        <view class="func-item" v-for="(item, index) in mainFuncItems" :key="index" @click="handleMainFuncRoute(item)">
          <u-image width="44px" height="44px" :src="item.pic"></u-image>
          <view class="func-itemTitle">{{ item.title }}</view>
          <view class="func-itemTitleSub">{{ item.subTitle }}<span v-if="index===0">{{ resumeScore }}项</span></view>
        </view>
      </view>

      <view class="other-func">
        <view class="section-title">其他功能</view>
        <u-grid :border="false" :col="4">
           <u-grid-item v-for="(item, index) in (isShowMoreFunc ? otherFuncItems : otherFuncItems.slice(0, 8))" :key="index" @click="handleOtherFuncRoute(item)">
            <u-badge :count="item.count" :offset="[20, 20]"></u-badge>
            <u-image width="22px" height="22px" :src="item.pic"></u-image>
            <view class="section-item-title">{{ item.title }}</view>
          </u-grid-item>
        </u-grid>
        <view v-if="!isShowMoreFunc" class="more-func" @click="handleMoreFunc()">
          <u-image width="14px" height="10px" :src="moreImg"></u-image>
        </view>
      </view>

      <view v-if="personId && userInfo && userInfo.id" class="btn-logOut" @click="handleLogOut"> 退出登录 </view>
    </view>

    <LoginDialog ref="loginDialog" @loginSuccessBack="loginSuccessBack"></LoginDialog>

    <!-- 大弹窗 -->
    <!-- <ActPromotion
      :show="showActPromotion"
      :backgroundSrc="alertGoods.goodsPic"
      @close="closeAlert"
      @next="clickAlert"
    ></ActPromotion> -->
  </page-wrap>
</template>

<script>
import { getProductGroup } from '@/api/modules/career.js';
import ShareMixin from '@/mixins/share';
import loginOutMixin from '@/mixins/login-out.js';
import loginMixin from '@/mixins/login.js';
import LoginDialog from '@/components/LoginDialog';
import { getResumeOpinionNum } from '@/api/modules/career';
import { getUserInfo, addBuryingPoint, getAdvLists,getRecordData, getToastProId } from '@/api/modules/career';
import ActPromotion from '../../components/activities/activitiePromotion.vue';

import { getPersonDetail, isCompanyPersonOld, isCompanyPerson, entryPermission, refreshResume } from '@/api/index';
import { remove } from '@vue/shared';

export default {
  components: {
    LoginDialog,
    ActPromotion,
  },
  mixins: [ShareMixin, loginOutMixin, loginMixin],
  data() {
    return {
      arrowImg: this.$imgBase + 'mine/arror_right.png',
      editImg: this.$imgBase + 'mine/edit.png',
      defaultAvatar: this.$imgBase + 'common/avatar_default.png',
      moreImg: this.$imgBase + 'mine/arrow_down.png',
      headerItems: [
        {
          title: '投递',
          num: '0',
          count: '0',
          path: '/pagesSub/userCenter/deliveryRecord/index',
        },
        {
          title: '面试',
          num: '0',
          count: '0',
          path: '/pagesSub/public/interviewNotice/index',
        },
        {
          title: '收藏',
          num: '0',
          count: '0',
          path: '/pagesSub/userCenter/positionCollection/index',
        },
      ],

      mainFuncItems: [
        {
          pic: this.$imgBase + 'mine/onlineResume.png',
          title: '在线简历',
          subTitle: '待优化',
          path: '/pagesSub/newResume/index',
        },
        {
          pic: this.$imgBase + 'mine/enclosure.png',
          title: '附件简历',
          subTitle: '上传/制作简历',
          path: '/pagesSub/userCenter/enclosure/index',
        },
        {
          pic: this.$imgBase + 'mine/aim.png',
          title: '求职意向',
          subTitle: '暂不跳槽',
          path: '/pagesSub/resume/aim/index',
        },
        {
          pic: this.$imgBase + 'mine/upResume.png',
          title: '简历优化',
          subTitle: '我要涨薪',
          path: '/pagesSub/userCenter/careerPathV2/components/CBuyPage?etId=20023',
        },
      ],

      otherFuncItems: [
        {
          title: '关注的企业',
          pic: this.$imgBase + 'mine/concernCompany.png',
          count: '0',
          path: '/pagesSub/userCenter/concernCompany/index',
        },
        {
          title: '职途卡',
          pic: this.$imgBase + 'mine/careerPath.png',
          count: '0',
          path: '/pagesSub/userCenter/careerPathV2/index',
        },
        {
          title: '我要招聘',
          pic: this.$imgBase + 'mine/recruit.png',
          count: '0',
          // path: '/pagesSub/public/character/index?active=company',
        },
        {
          title: '关注公众号',
          pic: this.$imgBase + 'mine/isux.png',
          count: '0',
          path: '/pagesSub/userCenter/companyIsux/index',
        },
        {
          title: '刷新简历',
          pic: this.$imgBase + 'mine/reload.png',
          count: '0',
        },
        {
          title: '简历外发',
          pic: this.$imgBase + 'mine/sendResume.png',
          count: '0',
          path: '/pagesSub/userCenter/sendResume/index',
        },
        {
          title: '下载App',
          pic: this.$imgBase + 'mine/downApp.png',
          count: '0',
          path: `/pagesSub/public/web/index?title=下载一览职业App&link=${encodeURIComponent('https://m.yl1001.com/apps/index/?hr=ylnew&from=miniprogram')}`,
        },
        {
          title: '设置',
          pic: this.$imgBase + 'mine/set.png',
          count: '0',
          path: '/pagesSub/public/setUp/index',
        },
        {
          title: '职业顾问管理',
          pic: this.$imgBase + 'mine/consultant.png',
          count: '0',
          path: `/pagesSub/career/consultant/index?id=${uni.getStorageSync('person-id').slice(2)}`,
        },
        {
          title: '我的报告',
          pic: this.$imgBase + 'mine/myReport.png',
          count: '0',
          path: '/pagesSub/userCenter/myReport/index',
        },
        {
          title: '我的订单',
          pic: this.$imgBase + 'mine/order.png',
          count: '0',
          path: '/pagesSub/public/order/index',
        },
      ],
      isShowMoreFunc: false,

      advItems: [
      ],

      // productSign: '',
      resumeOpinionNum: 0,
      startScore: 0,
      currentScore: 0,
      resumeScore: 0,
      uNavColor: this.$uNavColor,
      personId: uni.getStorageSync('person-id').slice(2) || undefined,
      userInfo: {},
      info: {},
      
     
      isCompany: false,
      showTop: false,
      navHeight: getApp().globalData.navHeight + uni.upx2px(114),

      showEntry: false, // 招聘资料入口
      sharePath: '/pages/userCenter/index',
      isLogin: false,
      interval: '',
      showActPromotion: true,
      buryingPointId: '',
      cardType: '',
      alertGoods: {
        goodsPic: this.$imgBaseSelf + 'career/positionDictionary/bannerAlert_699.png', //
        goodsId: '128317245100125',
      },
    };
  },

  created() {
    this.getHomeAdvLists();
    if (!this.personId) return;

    // getApp().watch((val) => {
    //   this.kingKongList[0].cnt = val;
    // }, 'meCount');
    this.$bus.$on('updatePersonDetail', this.getPersonDetail);
    this.isLogin = true;
    // const globalData = getApp().globalData;
  },

  onShow() {
    this.personId = uni.getStorageSync('person-id').slice(2) || undefined;
    this.refreshInfo();
    if (this.personId && !this.isLogin) {
      this.isLogin = true;
    } else {
      this.isLogin = false;
    }
  },

  onHide() {
    this.$bus.$emit('setVippopUpVisible', false);
  },

  beforeDestroy() {
    this.$bus.$off('updatePersonDetail');
  },

  onPageScroll(res) {
    this.showTop = res.scrollTop > 0;
  },
  methods: {
    // 处理信息项点击
    handleMessageRoute(item) {
      if (!this.personId) {
        this.showLoginDialog();
        return;
      }

      uni.navigateTo({
        url: item.path,
      });
    },

    // 处理功能项点击
    handleMainFuncRoute(item) {
      if (!this.personId) {
        this.showLoginDialog();
        return;
      }

      if (item.isTab) {
        uni.switchTab({
          url: item.path,
        });
      } else {
        uni.navigateTo({
          url: item.path,
        });
      }
    },

    // 处理其他功能项点击
    handleOtherFuncRoute(item) {
      if (item.title == '关注公众号') {
          uni.navigateTo({
          url: item.path,
        });
        return;
      }

      if (!this.personId) {
        this.showLoginDialog();
        return;
      }

      if (item.path) {
        if (item.title == '简历优化') {
          this.addBuryingPointFn(20023, '', '', '', '');
          wx.reportEvent('my_page_resume_improve', {});
        }

        uni.navigateTo({
          url: item.path,
        });
      } else {
        if (item.title == '我要招聘') {
          this.jumpToMP();
          return;
        }
        if (item.title == '刷新简历') {
          this.handleReflesh();
          return;
        }
        if (item.title === '下载App') {
          let linkUrl = item.url;
          uni.navigateTo({
            url: `/pagesSub/public/web/index?title=下载一览职业App&link=${encodeURIComponent(linkUrl)}`,
          });
          return;
        }
        uni.showToast({
          title: '功能开发中',
          icon: 'none',
        });

      }
    },

    handleMoreFunc() {
      this.isShowMoreFunc = !this.isShowMoreFunc;
    },

    jumpToMP() {
      uni.showModal({
        title: '温馨提示',
        content: '您好，请前往"一览通官方号"小程序使用一览通企业权益！',
        success: function (res) {
          if (res.confirm) {
            uni.navigateToMiniProgram({
              appId: 'wx384a7e29f79f2fb6',
              path: 'pages/index/index',
              success(res) { },
              fail(err) { },
            });
          } else if (res.cancel) {
          }
        },
      });
    },
    handleReflesh() {
      let param = {
        person_id: this.personId,
      };
      refreshResume(param).then((res) => {
        if (res && +res.code === 200) {
          uni.showToast({ icon: 'none', title: '刷新成功' });
        }
      });
    },

    handleBannerLive(index) {
      let obj = this.advItems[index];
      let type = obj._param.type;
      if (type === '3g') {
        let url = obj.url;
        uni.navigateTo({
          url: `/pagesSub/public/web/index?title=${obj.title}&link=${encodeURIComponent(url)}`,
        });
        return;
      }
      if (type === 'mini') {
        let url = obj.url;
        uni.navigateTo({
          url: url,
        });
        return;
      }
    },


    // ====================================================
    // ==========获取用户简历评分

    // 获取头部信息个数
    getRecordInfo() {
      const params = {
        person_id: this.personId,
      };
      getRecordData(params)
        .then((res) => {
          if (res.code == 200 && res.data) {
            /*  zhudong_cnt = 看过我*/
            this.headerItems[0].num = res.data.toudi_cnt || "0";
            this.headerItems[1].num = res.data.mianshi_cnt || "0";
            this.headerItems[2].num = res.data.pfavorite_count || "0";
          } else {
            this.headerItems[0].num = "0";
            this.headerItems[1].num = "0";
            this.headerItems[2].num = "0";
          }
        })
        .catch((e) => { 
          console.log("🚀 ~ getRecordData ~ e:", e)
        });
    },

    // 获取用户简历评分
    getHomeAdvLists() {
      const params = {
        type: "yl_resumecenter_banner",
      };
      getAdvLists(params)
        .then((res) => {
          console.log("🚀 ~ getHomeAdvLists ~ res:", res)
          if (res.code == 200) {
            this.advItems = res.data || [];
          } else {
            this.advItems = [];
          }
        })
        .catch((e) => { 
          console.log("🚀 ~ getHomeAdvLists ~ e:", e)
        });
    },

    // 获取用户简历评分
    getResumeOpinionStatus() {
      const params = {
        personId: this.personId,
      };
      setTimeout(() => {
        getResumeOpinionNum(params)
          .then((res) => {
            if (res.code == 200) {
              this.animateScore(res.data);
            }
          })
          .catch((e) => { });
      }, 1500);
    },
    //下面两个方法都是数字累加效果
    easeOutQuadratic(t) {
      return -1 * t * (t - 2);
    },
    animateScore(resumeOpinionNum) {
      this.resumeScore = resumeOpinionNum;
      if (this.interval) return;
      const targetScore = resumeOpinionNum;
      let currentTime = 0;
      const totalTime = 2000; // Total animation time in milliseconds

      this.interval = setInterval(() => {
        currentTime += 20; // Interval time
        const progress = currentTime / totalTime;
        this.currentScore = Math.round(this.easeOutQuadratic(progress) * (targetScore - this.startScore) + this.startScore);
        if (currentTime >= totalTime) {
          clearInterval(this.interval);
          this.interval = null;
        }
      }, 20);
    },

    refreshInfo() {
      let tabBarList =
        getApp().globalData.loginStatus === 'company' ? getApp().globalData.companyTabs : getApp().globalData.personTabs;
      getApp().globalData.tabBarList = tabBarList;

      this.getUserInfoFn();
      this.addCareerConsultantOptions();

      this.getPersonDetail(true);
      this.getCompanyPersonInfo();

      this.getResumeOpinionStatus();
      this.getRecordInfo();
    },


    // 添加职途卡、添翼就业服务卡
    getUserInfoFn() {
      // 这个uid一定要传，因为在interceptors中，没有传参的请求的请求头不会带上uid，而这个请求一定要uid
      getUserInfo({ uid: '' }).then((res) => {
        if (res.code == 200 && res.data.cardVersion) {
          const cardVersion = res.data.cardVersion;
          uni.setStorageSync('personName', res.data.personName);
          var ntbName;
          if (res.data.cardType == 1) {
            ntbName = '添翼就业服务卡';
            const temp = this.otherFuncItems.find((item) => item.title === ntbName); // cardVersion
            if (!temp) {
              const url = `/pagesSub/userCenter/${cardVersion == '2' ? 'careerPathV2' : 'careerPath'}/index`;
              const consultantOption = {
                title: ntbName,
                pic: this.$imgBase + 'common/careerPath.png',
                count: '0',
                path: url,
              };
              const appIndex = this.otherFuncItems.findIndex((item) => item.title === '关注的企业');
              if (appIndex !== -1) {
                this.otherFuncItems.splice(appIndex + 1, 1, consultantOption);
              } else {
                this.otherFuncItems.unshift(consultantOption);
              }
            }
          } else {
            ntbName = '职途卡';
          }
        }
      });
    },

    // 添加职途顾问选项
    addCareerConsultantOptions() {
      if (!getApp().globalData.userIsConsultant) return;
      const temp = this.otherFuncItems.find((item) => item.title === '职途顾问');
      if (!temp) {
        // 如果没有“我是职途顾问”选项，则添加
        const appIndex = this.otherFuncItems.findIndex((item) => item.title === '设置');
        const consultantOption = {
          title: '职途顾问',
          pic: this.$imgBase + 'mine/character.png',
          count: '0',
          path: '/pagesSub/public/character/index?active=consultant',
        };
        if (appIndex !== -1) {
          this.otherFuncItems.splice(appIndex + 1, 0, consultantOption);
        } else {
          this.otherFuncItems.unshift(consultantOption);
        }
      }
    },


    // 获取个人信息
    getPersonDetail(update) {
      if (!getApp().globalData.userInfo || !getApp().globalData.userInfo.id || update) {
        if (!this.personId) {
          return;
        }
        let param = {
          param: JSON.stringify({
            personId: this.personId,
          }),
          where: '',
          slaveInfo: 1,
        };
        getPersonDetail(param).then((res) => {
          this.userInfo = res.data || res;
          if (this.userInfo.pic && this.userInfo.pic.indexOf('img.job1001.com/myUpload/pic.gif') >= 0) {
            this.userInfo.pic = this.$defalutAvatar;
          }
          getApp().globalData.userInfo = this.userInfo;
          // 获取资料列表入口权限
          this.getAuth();
        });
      } else {
        this.userInfo = getApp().globalData.userInfo;
        // 获取资料列表入口权限
        this.getAuth();
      }
    },
    // 获取企业信息
    getCompanyPersonInfo() {
      let params = {
        person_id: this.personId,
      };
      isCompanyPerson(params).then((res) => {
        if (res && res.code == 200) {
          uni.setStorageSync('company-id', res.info.company_id);
          this.setOptionList();
        } else {
          params = {
            personId: this.personId,
          };
          isCompanyPersonOld(params).then((oldRes) => {
            if (oldRes && oldRes.code == 200) {
              uni.setStorageSync('company-id', oldRes.company_id);
              this.setOptionList();
            } else {
              uni.removeStorageSync('company-id');
            }
          });
        }
      });
    },
    setOptionList() {
      this.isCompany = true;
    },
    //普通的埋点+事件停留埋点
    async addBuryingPointFn(etId, statType, jumpPersonId, jumpSource, sourceType) {
      const params = {
        etId: etId,
        id: this.buryingPointId ? this.buryingPointId : '', //后台要求不能传空，未登录也要统计
        personId: uni.getStorageSync('person-id').slice(2) || '0',
        cardType: this.cardType ? this.cardType : uni.getStorageSync('cardType') || this.cardType,
        consultantId: uni.getStorageSync('sellId') ? uni.getStorageSync('sellId') : '',
        originType: this.originFrom == 'shareLink' ? 10 : 20,
        statType: statType ? statType : '10',
        jumpPersonId: jumpPersonId,
        jumpSource: jumpSource,
        sourceType: sourceType,
      };
      const res = await addBuryingPoint(params);
    },

    // 20250611 - 黄玲 - 删除招聘资料入口
    // 招聘资料入口权限
    getAuth() {
      // const params = {
      //   tel: this.userInfo.shouji,
      //   name: this.userInfo.name,
      // };
      // entryPermission(params).then((res) => {
      //   if (res && res.data && res.data.isShowEntry == 1) {
      //     this.showEntry = true;
      //   }
      // });
    },

    // 跳转内嵌H5
    handleEntry() {
      uni.navigateTo({
        url: '/pagesSub/userCenter/hrList/index',
      });
    },

    // 进入在线简历
    toResume() {
      if (!this.personId) {
        this.showLoginDialog();
        return;
      }
      uni.navigateTo({
        url: '/pagesSub/newResume/index',
      });
    },

    // ====BEGIN==== 登录相关 ======
    // ========

    // 显示登录对话框
    showLoginDialog() {
      this.$refs.loginDialog.setVisibility(true);
    },
    // 退出登录
    handleLogOut() {
      this.loginOut(null, () => {
        this.personId = '';
      });
    },
    // 登录成功回调
    loginSuccessBack() {
      this.personId = uni.getStorageSync('person-id').slice(2) || undefined;
      if (this.personId && !this.isLogin) {
        this.refreshInfo();
        this.isLogin = true;
        // getApp().watch((val) => {
        //   this.kingKongList[0].cnt = val;
        // }, 'meCount');
        this.$bus.$on('updatePersonDetail', this.getPersonDetail);
      }
    },

    // ========
    // ===END===== 登录相关 ======



    // ====BEGIN==== AI面评推广相关 ======
    // ========

    // getAlertToastProId() {
    //   getToastProId().then((res) => {
    //     if (res.data) {
    //       console.log('---getAlertToastProId-------->', res.data);
    //       this.alertGoods = res.data;
    //     }
    //   });
    // },

    // showAIAlert() {
    //   let that = this;
    //   // 每次打开小程序只显示1次（改为每天弹一次）
    //   if (!this.showedPromotionAlert) {
    //     this.showedPromotionAlert = true;
    //     var nowTime = new Date();
    //     uni.getStorage({
    //       key: "userDidClickActCollegeAlertTime",
    //       success: function (res) {
    //         var localStorageTime = res.data;
    //         if (
    //           nowTime.getFullYear() != localStorageTime.getFullYear() ||
    //           nowTime.getMonth() != localStorageTime.getMonth() ||
    //           nowTime.getDay() != localStorageTime.getDay()
    //         ) {
    //           //年月日不同
    //           console.log(
    //             "------userDidClickActCollegeAlertTime---success-- > 1天-->",
    //             nowTime,
    //             localStorageTime
    //           );
    //           that.showActPromotion = true;
    //         } else {
    //           console.log(
    //             "------userDidClickActCollegeAlertTime---success-- < 1天-->",
    //             nowTime,
    //             localStorageTime
    //           );
    //           that.showActPromotion = false;
    //         }
    //       },
    //       fail: function () {
    //         console.log(
    //           "------userDidClickActCollegeAlertTime----fail--->",
    //           nowTime
    //         );
    //         that.showActPromotion = true;
    //       },
    //     });
    //   }
    // },

    // clickNext() {
    //   wx.reportEvent("home_alert_college_advertise_click", {}); //首页弹窗进入营销页
    //   this.addBuryingPointFn(20090, "", "", "", "");
    //   this.showActPromotion = false;
    //   /* 高中生职途小程序入口AB测试 20240611邹凌风废弃*/
    //   // const res = wx.getExptInfoSync(["expt_1716533327"]);
    //   // if (res.expt_1716533327 === undefined) {
    //   //   /* 返回空对象；未命中实验、实验待发布（白名单除外）或者实验结束后会命中该分支 */
    //   //   /* 业务逻辑，可对齐线上 */
    //   //   uni.navigateTo({
    //   //     url: "/pagesSub/careerGrow/collegeAdvertise/index",
    //   //   });
    //   // } else if (res.expt_1716533327 == "0") {
    //   //   /* 对照组业务逻辑 */
    //   //   uni.navigateTo({
    //   //     url: "/pagesSub/careerGrow/careerSearch/index",
    //   //   });
    //   // } else if (res.expt_1716533327 == "1") {
    //   //   /* 实验组1业务逻辑 */
    //   //   uni.navigateTo({
    //   //     url: "/pagesSub/careerGrow/collegeAdvertise/index",
    //   //   });
    //   // } else {
    //   //   /* 异常分支逻辑 */
    //   //   uni.navigateTo({
    //   //     url: "/pagesSub/careerGrow/collegeAdvertise/index",
    //   //   });
    //   // }
    //   uni.navigateTo({
    //     url: "/pagesSub/careerGrow/careerSearch/index",
    //   });
    // },
    // // // 数据统计
    // pointCount(step) {
    //   let eventTitle = step == 1 ? "首页按钮点击" : "首页弹窗点击";
    //   const params = {
    //     personId: this.personId,
    //     platform: "1",
    //     optCode: "aiPromotion",
    //     subOptCode: eventTitle,
    //     optIndex: step,
    //     description: "首页AI面评推广",
    //     moduleType: "demonstrate", // 模块类型(zt:职途，zph：招聘会活动-百职万岗，demonstrate：演示-扎堆)
    //   };
    // },
    // // 点击推广弹窗
    // clickAlert() {
    //   this.showActPromotion = false;
    //   var nowTime = new Date(); //点击以后一天弹一次
    //   uni.setStorage({
    //     key: "userDidClickActCollegeAlertTime",
    //     data: nowTime,
    //     success: function () {},
    //   });
    //   this.pointCount(2);
    //   // this.clickNext();
    //   this.addBuryingPointFn(20067, "", "", "", ""); //点击弹窗
    //   if (this.alertGoods.goodsId == "128317245100125") {
    //     wx.reportEvent("banner_alert_699_click", {}); //进入699商品页
    //   } else {
    //     wx.reportEvent("banner_alert_8980_click", {}); //进入8980商品页
    //   }
    //   // 跳转进商品详情页
    //   uni.navigateToMiniProgram({
    //     appId: "wx614f8a78fff34162",
    //     path:
    //       "/ec_goods/detail?productInstanceId=16868908125&vid=0&id=" +
    //       this.alertGoods.goodsId,
    //     success(res) {},
    //     fail(err) {},
    //   });
    // },
    // closeAlert() {
    //   this.showActPromotion = false;
    //   var nowTime = new Date(); //点击以后一天弹一次
    //   uni.setStorage({
    //     key: "userDidClickActCollegeAlertTime",
    //     data: nowTime,
    //     success: function () {},
    //   });
    //   this.pointCount(2);
    // },

    // ========
    // ===END===== AI面评推广相关 ======
  },
};
</script>

<style lang="scss">
$img-base-mine: $img-base + 'mine/';
@include img-base-self('.person-top', 'pcenter/bg.png?v=1');

::v-deep .u-close--top-right {
  top: 5rpx !important;
  right: 5rpx !important;
}

.page-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: url($img-base-mine + 'minebg.png') no-repeat top / 100% 30% #f5f5f5;

  .header-area {
    margin-top: 88px;
    width: 100%;

    .header-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 32rpx;
      font-family: MiSans, MiSans;

      .header-user-info {
        display: flex;
        align-items: center;
        text-align: left;

        .header-user-name {
          line-height: 20px;
          color: #222222;
          margin-left: 11rpx;
          font-weight: 500;
          font-size: 40rpx;
          font-weight: bold;
        }

        .header-user-tips {
          margin-left: 11rpx;
          font-weight: 400;
          font-size: 24rpx;
          color: #555555;
          line-height: 12px;
        }
      }

      .header-resume-tips {
        font-weight: 400;
        font-size: 12px;
        color: #888888;
        line-height: 12px;
        text-align: left;
      }
    }

    .header-bottom {
      margin-top: 16px;

      width: 100%;
      display: flex;
      justify-content: space-around;

      .header-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 90px;
        height: 50px;
        font-size: 11px;
        line-height: 11px;
        font-weight: 400;
        color: #555555;
        font-family: MiSans, MiSans;

        .header-itemNum {
          font-weight: 500;
          font-size: 16px;
          color: #222222;
          line-height: 16px;
        }

        .header-itemTitle {
          font-size: 11px;
          color: #555555;
          margin-top: 8px;
        }
      }
    }
  }

  .main-func {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: white;
    border-radius: 8px 8px 8px 8px;
    margin: 7px 7px 0 7px;
    padding: 27rpx 26rpx 30rpx 26rpx;

    .func-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-family: MiSans, MiSans;
      text-align: center;

      .func-itemTitle {
        text-align: center;
        font-weight: 400;
        font-size: 11px;
        color: #222222;
        // color: red;
        margin-top: 10px;
        margin-bottom: 1px;
      }

      .func-itemTitleSub {
        font-family: MiSans, MiSans;
        font-weight: 400;
        font-size: 10px;
        color: #888888;
      }
    }
  }

  .special-function {
    height: 77px;
    width: 100%;
    border-radius: 8px 8px 8px 8px;
    padding: 7px;
  }

  .other-func {
    background-color: white;
    border-radius: 8px 8px 8px 8px;
    margin: 7px;
    padding: 11px;
    font-family: MiSans, MiSans;

    .section-title {
      font-weight: 500;
      font-size: 13px;
      color: #222222;
      margin-left: 6px;
      margin-top: 4px;
      margin-bottom: 6px;
    }

    .section-item-title {
      font-weight: 400;
      font-size: 11px;
      color: #555555;
      line-height: 11px;
      text-align: center;
      margin-top: 8px;
    }

    .more-func {
      display: flex;
      justify-content: center;
      align-items: flex-end;
      height: 28px;
    }
  }

  .btn-logOut {
    // flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px 48px;
    height: 44px;
    background: #f0f0f0;
    border-radius: 8px 8px 8px 8px;
    font-weight: 400;
    font-size: 14px;
    color: #888888;
  }

  .flex-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 18rpx;
  }

  .margin-left-10 {
    margin-left: 10rpx;
  }
}

.person-top {
  height: 100rpx;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% 100%;
  border-radius: 0 0 68rpx 68rpx;
}
</style>
